const BASE_URL = "http://localhost:8090"
export const myRequest = (options)=>{
	return new Promise((resolve,reject)=>{
		uni.request({
			url:BASE_URL+options.url,
			method:options.method || 'GET',
			data:options.data || {},
			success: (res)=> {
				if (res.data.code != 200) {
					uni.showToast({
						title: res.data.msg,
						icon: "none",
						mask: true,
						position: "top"
					});
				}else{}
				resolve(res)
				
			},
			fail: (err) => {
				uni.showToast({
					title: "请求接口失败",
					icon: "none",
					mask: true,
					position: "top"
				});
				reject(err)
			}
		})
	})
}

/* myRequest({
	url:"",
	method:'post'
}) */